<%@ page import="java.util.Date" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <title></title>
</head>
<body>
    <%
        Calendar c=Calendar.getInstance();
       // SimpleDateFormat fo=new SimpleDateFormat("yyyy-MM-dd");
       // String time=fo.format(c);
        int year=c.get(Calendar.YEAR);
        int month=c.get(Calendar.MONTH);
        int day=c.get(Calendar.DAY_OF_MONTH);
        int hour=c.get(Calendar.HOUR_OF_DAY);
        int second=c.get(Calendar.SECOND);
        int week=c.get(Calendar.DAY_OF_WEEK);
        out.print("当前时间是："+year+"-"+month+1+"-"+day+"星期"+week);
       if (hour<12&&hour>=0) {
            out.print("早上好<br>");
       }
       if (hour<=18&&hour>=12){
           out.print("下午好<br>");
       }
       else {
           out.print("晚上好<br>");
       }

    %>
 </body>
</html>
